import org.softmed.rest.generation.xml.PagedList;



pagedList = new PagedList();

if(itemCount > 0)
pagedList.setCurrentItemsPerPage(itemCount);

boolean detailed = queryParameters.getFirst("detailed") != null;

pagedList.setupPage(detailed, count, page, baseURI);
initialIndex = pagedList.getInitialIndex();
finalIndex = pagedList.getFinalIndex()+1;
if(finalIndex>count)
	finalIndex = (Integer)count;

//println initialIndex;
//println finalIndex;
//println itemCount;

if(initialIndex >= finalIndex)
{
	throw new SimpleException("The requested paged list with the specified size could not be built.");
}


